import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { EmgCompanyVO, EmgCompanyForm, EmgCompanyQuery } from '@/api/biz/emgCompany/types';

/**
 * 查询重点企业列表
 * @param query
 * @returns {*}
 */

export const listEmgCompany = (query?: EmgCompanyQuery): AxiosPromise<EmgCompanyVO[]> => {
  return request({
    url: '/biz/emgCompany/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询重点企业详细
 * @param id
 */
export const getEmgCompany = (id: string | number): AxiosPromise<EmgCompanyVO> => {
  return request({
    url: '/biz/emgCompany/' + id,
    method: 'get'
  });
};

/**
 * 新增重点企业
 * @param data
 */
export const addEmgCompany = (data: EmgCompanyForm) => {
  return request({
    url: '/biz/emgCompany',
    method: 'post',
    data: data
  });
};

/**
 * 修改重点企业
 * @param data
 */
export const updateEmgCompany = (data: EmgCompanyForm) => {
  return request({
    url: '/biz/emgCompany',
    method: 'put',
    data: data
  });
};

/**
 * 删除重点企业
 * @param id
 */
export const delEmgCompany = (id: string | number | Array<string | number>) => {
  return request({
    url: '/biz/emgCompany/' + id,
    method: 'delete'
  });
};
